package bean;

import lombok.*;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 * @classname:Role
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/29 21:28
 * @version: 0.1
 * @since:1.8
 */
@Setter
@Getter
@AllArgsConstructor

@ToString
public class Role {
    private Integer id;
    private String roleName;
    private String roleDesc;
    private Date create_time;
    private Date update_time;


    public Role(ResultSet rs) {
        try {
            this.id = rs.getInt("id");
            this.roleName = rs.getString("roleName");
            this.roleDesc = rs.getString("roleDesc");;
            this.create_time = (Date) rs.getObject("create_time");
            this.update_time =  (Date) rs.getObject("update_time");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public Role() {
    }
}
